#include "MouseMotionArtifacts.h"

#include "CatanClassContractException.h"

namespace catan
{

MouseMotionArtifacts::MouseMotionArtifacts(): _hasMouseMotionRoad(false), mouseMotionRoad(catan::x3, catan::y3, catan::verticalTR), _hasMouseMotionSettlement(false), _isMouseMotionSettlementUpgraded(false), mouseMotionSettlement(catan::x3, catan::y3, catan::horizontalCR)
{
}

bool MouseMotionArtifacts::hasMouseMotionRoad()
{
	return _hasMouseMotionRoad;
}

PathCoordinate MouseMotionArtifacts::getMouseMotionRoad()
{
	if (!hasMouseMotionRoad())
	{
		throw CatanClassContractException(__FILE__, __LINE__, "MouseMotionArtifact::hasMouseMotionRoad() should be true before calling MouseMotionArtifacts::getMouseMotionRoad().");
	}
	return mouseMotionRoad;
}

void MouseMotionArtifacts::unsetMouseMotionRoad()
{
	_hasMouseMotionRoad = false;
}

void MouseMotionArtifacts::setMouseMotionRoad(PathCoordinate mouseMotionRoad)
{
	this->mouseMotionRoad = mouseMotionRoad;
	_hasMouseMotionRoad = true;
}

bool MouseMotionArtifacts::hasMouseMotionSettlement()
{
	return _hasMouseMotionSettlement;
}

bool MouseMotionArtifacts::isMouseMotionSettlementUpgraded()
{
	return _isMouseMotionSettlementUpgraded;
}

SiteCoordinate MouseMotionArtifacts::getMouseMotionSettlement()
{
	if (!hasMouseMotionSettlement())
	{
		throw CatanClassContractException(__FILE__, __LINE__, "MouseMotionArtifact::hasMouseMotionSettlement() should be true before calling MouseMotionArtifacts::getMouseMotionSettlement().");
	}
	return mouseMotionSettlement;
}

void MouseMotionArtifacts::unsetMouseMotionSettlement()
{
	_hasMouseMotionSettlement = false;
	_isMouseMotionSettlementUpgraded = false;
}

void MouseMotionArtifacts::setMouseMotionSettlement(SiteCoordinate mouseMotionSettlement)
{
	this->mouseMotionSettlement = mouseMotionSettlement;
	_hasMouseMotionSettlement = true;
	_isMouseMotionSettlementUpgraded = false;
}

void MouseMotionArtifacts::setMouseMotionCity(SiteCoordinate mouseMotionCity)
{
	this->mouseMotionSettlement = mouseMotionCity;
	_hasMouseMotionSettlement = true;
	_isMouseMotionSettlementUpgraded = true;
}

void MouseMotionArtifacts::clear()
{
	unsetMouseMotionRoad();
	unsetMouseMotionSettlement();
}

}